import { getBannerAPI } from '@/apis/home';
import { ref, onMounted } from 'vue'

export function useBanner() {
  // 轮播图
  const bannerList = ref([])
  const getBanner = async () => {
    // 注意传参的方式
    const res = await getBannerAPI({
      distributionSite: '2'
    })
    bannerList.value = res.result
    // console.log('banner数据:',bannerList.value)
  }

  onMounted(() => {
    getBanner()
  })

  return {
    bannerList
  }
} 